<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <title>稻稻工厂—商户自营管理</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/colorpicker.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/datepicker.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/uniform.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/select2.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/matrix-style.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/matrix-media.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap-wysihtml5.css" />
    <link href="/thinkphp/Public/admin/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href='http://fonts.useso.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
    <script src="/thinkphp/Public/admin/js/jquery.min.js"></script>
    <style>
        .floatWindow{
            left:5%;
            top:4%;
            background:#E6E6E6;
            width:90%;
            height:90%;
            position: absolute;
            z-index:100;
            /*IE4-IE9*/
            filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
            color:#939DA8;
            display:none;
            overflow:scroll;
        }
        .floatWindow ul{
            z-index:999;
            margin:0 auto;
            list-style:none;
            width:90%;
            margin-top:5%;
        }
        .floatWindow ul li{
            margin-top:20px;
            font-size:12px;
            color:#939DA8;
            text-align:left;
        }
        .floatWindow ul li span{
            width:100%;
            float:left;
            color:#939DA8;;
            font-weight:900;
            font-size:12px;
            text-align: center;;
        }
        </style>
</head>

<body style="height:100%">
<!--1--->
<div class="floatWindow" onclick="closeFloatWindow()">
    <ul>
        <li>
            订单编号：
            <span></span>
        </li>
        <li>
            订单状态：
            <span></span>
        </li>
        <li>
            支付状态：
            <span></span>
        </li>
        <li>
            支付方式：
            <span></span>
        </li>
        <li>
            收货人：
            <span></span>
        </li>
        <li>
            详细地址：
            <span></span>
        </li>
        <li>
            联系方式
            <span></span>
        </li>
        <li>
            收货方式：
            <span></span>
        </li>
        <li>
            订单生成时间：
            <span></span>
        </li>
    </ul>
</div>
<!--1ENd--->
<div id="content">
    <div class="container-fluid">
        <hr>
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-content nopadding">
                    <form name="orderCond" method="post">
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=1');?>" name="pay_status_b" />
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=2');?>" name="pay_type_b" />
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=3');?>" name="time" />
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=4');?>" name="order_sn_b" />

                        <div class="control-group">
                            <div class="controls">
                                <select name="pay_status" class="span2" onchange="sub_pay_status(1)">
                                    <option selected="selected"> -- 支付状态 -- </option>
                                    <option value="0">未付款</option>
                                    <option value="1">付款中</option>
                                    <option value="2">已付款</option>
                                </select>
                            </div>
                        </div>
                        <script>
                            var pay_status=<?php echo ($pay_status); ?>;
                            if(typeof(pay_status)=='number') {
                                $("select[name='pay_status']").children("option").each(
                                    function(){
                                        alert($(this).val());
                                        if($(this).val()==pay_status)
                                        {
                                            alert($(this).val());
                                            $(this).attr("selected","selected");
                                        }
                                    }
                                );
                            }
                        </script>
                        <div class="control-group">
                            <div class="controls">
                                <select name="pay_type" class="span2" onchange="sub_pay_status(2)">
                                    <option selected="selected"> -- 支付方式 -- </option>
                                    <option value="0">货到付款</option>
                                    <option value="1">微信支付</option>
                                    <option value="2">门店自提</option>
                                    <option value="all">全部订单</option>
                                </select>
                            </div>
                        </div>
                        <script>
                            var pay_type=<?php echo ($pay_type); ?>;
                            if(pay_type!="") {
                                $("select[name='pay_type']").children("option").each(
                                        function(){
                                            if($(this).val()==pay_type)
                                            {
                                                $(this).attr("selected","selected");
                                            }
                                        }
                                );
                            }
                        </script>
                        <div class="control-group">
                            <div class="controls">
                                <input name="order_sn" class="span2" value="" onblur="sub_pay_status(4)" placeholder="订单编码"/>
                            </div>
                        </div>

                        <div class="control-group">
                            <div class="controls">
                                <input style="width:45%" name="endTime" readonly="readonly" type="text" data-date-format="mm-dd-yyyy" class="datepicker span2" placeholder="时间范围(起)" onclick="sub_pay_status(3)">
                                <input style="width:45%" name="startTime" readonly="readonly" type="text" data-date-format="mm-dd-yyyy" class="datepicker span2" placeholder="时间范围(止)" onclick="sub_pay_status(3)">
                            </div>
                        </div>

                        <div class="control-group">
                            <div class="controls">
                                <a class="btn btn-primary" style="float:left;" href="<?php echo U('Business/myOrder');?>">所有信息</a>
                            </div>
                        </div>

                    </form>
                </div>
                <script>
                    function sub_pay_status(action)
                    {

                        if(action==1)
                        {
                            var url=$("input[name='pay_status_b']").val();
                            document.orderCond.action=url;
                            orderCond.submit();
                        }
                        else if(action==2)
                        {
                            var url=$("input[name='pay_type_b']").val();
                            document.orderCond.action=url;
                            orderCond.submit();
                        }
                        else if(action==3)
                        {
                            var startTime=$("input[name='startTime']").val();
                            var endTime=$("input[name='endTime']").val();
                            if(startTime!=""&&endTime!="")
                            {
                                var url=$("input[name='time']").val();
                                document.orderCond.action=url;
                                orderCond.submit();
                            }
                        }
                        else if(action==4)
                        {
                            if($("input[name='order_sn']").val()!="")
                            {
                                var url = $("input[name='order_sn_b']").val();
                                document.orderCond.action = url;
                                orderCond.submit();
                            }
                        }
                    }

                </script>

                <div class="widget-box">

                    <div class="widget-content nopadding">
                        <table class="table table-bordered table-striped with-check">
                            <thead>
                            <tr>
                                <th>order_sn</th>
                                <!--<th>购买者</th>-->
                                <th>支付状态</th>
                                <th>支付方式</th>
                                <th>下单时间</th>
                                <!--<th>地址</th>-->
                            </tr>
                            </thead>

                            <?php if(is_array($orderList)): $i = 0; $__LIST__ = $orderList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tbody>
                                <tr onclick="orderInfo(<?php echo ($vo["id"]); ?>)">
                                    <td class="center"><?php echo ($vo["order_sn"]); ?></td>
                                    <!--<td class="center"><?php echo ($vo["username"]); ?></td>-->
                                    <td><?php echo ($vo["pay_status_b"]); ?></td>
                                    <td><?php echo ($vo["pay_type_b"]); ?></td>
                                    <td><?php echo ($vo["add_time_b"]); ?></td>
                                    <!--<td><?php echo ($vo["address"]); ?></td>-->
                                    <!--<td>-->
                                    <!--<a href="<?php echo U('Goods/delGoods',array('id'=>$vo['id']));?>" class="btn btn-inverse btn-mini">删除</a>-->
                                    <!--<a href="<?php echo U('Goods/updataGoods',array('id'=>$vo['id']));?>" class="btn btn-inverse btn-mini">修改</a>-->
                                    <!--<a id="add-event" data-toggle="modal" href="#modal-add-event" class="btn btn-inverse btn-mini" onclick="upMoreImg('<?php echo U('Goods/upMoreImg/',array('id'=>$vo['id']));?>')">上传图集</a>-->
                                    <!--</td>-->
                                </tr>
                                </tbody><?php endforeach; endif; else: echo "" ;endif; ?>
                        </table>
                        <script>
                            function orderInfo(id)
                            {
                                var orderID=id;

                                $.ajax({
                                    url:"<?php echo U('Business/orderInfo');?>",

                                    type: 'POST',

                                    data:{
                                        order_id:orderID
                                    },

                                    dataType: 'html',

                                    timeout: 1000,

                                    error: function(){alert('Error loading PHP document');},

                                    success: function(result){
                                        var one=result.split("/");
                                        var floatWindow=$(".floatWindow ul li");

                                        for(var i=0;i<=floatWindow.length;i++)
                                        {
                                            var a=floatWindow.children("span").eq(i).text(one[i]);
                                        }
                                        $(".floatWindow").show();
                                    }
                                });
                            }

                            function closeFloatWindow(){
                                $(".floatWindow").hide();
                            }
                        </script>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script src="/thinkphp/Public/admin/js/fullcalendar.min.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.calendar.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.tables.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.form_common.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.ui.custom.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap.min.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-colorpicker.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-datepicker.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.toggle.buttons.html"></script>
<script src="/thinkphp/Public/admin/js/masked.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.uniform.js"></script>
<script src="/thinkphp/Public/admin/js/select2.min.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.js"></script>
<script src="/thinkphp/Public/admin/js/wysihtml5-0.3.0.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.peity.min.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-wysihtml5.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.dataTables.min.js"></script>
<script src="/thinkphp/Public/admin/js/yanGradyJS/yanGrady.js"></script>